package com.example.jetpacktest.room

import androidx.room.*

//Dao类是一个 interface，其中定义了一系列的操作数据库的方法
@Dao
interface UserDao {

    @Query("select * from user where userId = :userId")
    fun getUserById(userId: Long): User

    @Query("select * from user")
    fun getUsers(): MutableList<User>

    @Insert
    fun insertUser(user: User)

    @Delete
    fun deleteUser(user: User)

    @Update
    fun updateUser(user: User)
}